﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using QuanLyDuocPham.Controllers;

namespace QuanLyDuocPham.View.QuanLyHeThong.DanhMuc
{
    /// <summary>
    /// Interaction logic for BACSI_Add_View.xaml
    /// </summary>
    public partial class BACSI_Add_View : Window
    {
        public BACSI_Add_View()
        {
            InitializeComponent();
        }
        string ma_bs;
        public string _ma_bs
        {
            set
            {
                ma_bs = value;
            }
        }
        QuanLyDuocPham.Controllers.QuanLyHeThong.DanhMuc.BACSI_Control bsctrl = new QuanLyDuocPham.Controllers.QuanLyHeThong.DanhMuc.BACSI_Control();
        public delegate void added();
        public added done;
        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            bsctrl.addData(ma_bs, txtHo_Ten, cmbChuyen_Khoa, txtDia_Chi, txtD_Thoai, txtD_Dong, txtTL_HoaHong, txtGhi_Chu);
            if (done != null)
            {
                done();
            }
            ma_bs=bsctrl.loadID_moi();
            txtHo_Ten.Clear();
            cmbChuyen_Khoa.SelectedItem = null;
            txtDia_Chi.Clear();
            txtD_Thoai.Clear();
            txtD_Dong.Clear();
            txtGhi_Chu.Clear();
            txtTL_HoaHong.Clear();
        }

        private void btBack_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ma_bs = bsctrl.loadID_moi();

        }

    }
}
